/*
 * This is the Model to Controler INTERFACE
 */
package model;

import java.net.InetAddress;
import java.nio.file.Path;
import java.util.ArrayList;

/**
 * ChatModel ctrlr is the only class to have a direct access to the model. Other
 * class must call the functions on its API to have an indirect access to the
 * model.
 *
 * @author Nana, gb
 */
public class ChatModelCtrlr implements ChatNI2ModelCtrlr, ChatGUI2ModelCtrlr {

    private ChatModelCtrlr2Model model;

    /**
     * An empty constructor
     */
    public ChatModelCtrlr() {
    }

    /**
     * Sets the model that the controller is going to control
     *
     * @param model the model it needs to control
     */
    public void setModel(ChatModelCtrlr2Model model) {
        this.model = model;
    }

    @Override
    public void setUsername(String username) {
        model.setUsername(username);
    }

    @Override
    public String getUsername() {
        return model.getUsername();
    }

    @Override
    public void setNetUsername(String netname) {
        model.setNetUsername(netname);
    }

    @Override
    public String getNetUsername() {
        return model.getNetUsername();
    }

    @Override
    public void setBroadcastIpAddress(InetAddress bdip) {
        model.setBroadcastIpAddress(bdip);
    }

    @Override
    public InetAddress getBroadcastIpAddress() {
        return model.getBroadcastIpAddress();
    }

    @Override
    public void addUserToList(String remoteNetname) {
        model.addUserToList(remoteNetname);
    }

    @Override
    public void delUserFromList(String remoteUsername) {
        model.delUserFromList(remoteUsername);
    }

    @Override
    public void addReceivedTextMessage(String message, String from, ArrayList<String> to) {
        model.addReceivedTextMessage(message, from, to);
    }

    @Override
    public void addSentTextMessage(String message, ArrayList<String> to) {
        model.addSentTextMessage(message, to);
    }

    @Override
    public void addTextNotifyFileReceived(String filename, String from, ArrayList<String> to, boolean boolReceived) {
        model.addTextNotifyFileReceived(filename, from, to, boolReceived);
    }

    @Override
    public void addTextNotifyFileTransmitted(String filename, String remoteUsername, boolean boolTransmitted) {
        model.addTextNotifyFileTransmitted(filename, remoteUsername, boolTransmitted);
    }

    @Override
    public void rememberFileProposal(String fileName, Path filePath, String curRmUser) {
        model.rememberFileProposal(fileName, filePath, curRmUser);
    }

    @Override
    public Path getFilePathForProposal(String fileName, String remoteNetname) {
        return model.getFilePathForProposal(fileName, remoteNetname);
    }

    @Override
    public void forgetFileProposal(String fileName, String remoteNetname) {
        model.forgetFileProposal(fileName, remoteNetname);
    }

    @Override
    public void emptyConnectedUsersList() {
        model.emptyConnectedUsersList();
    }
}
